<script setup>
import qrcode from './components/qrcode.vue'
import {Switch as EnableBtn} from "vant"
import { ref ,computed,watch,onMounted} from 'vue';
import axios from 'axios'
var status
var enable=ref(status)//服务器状态

axios.get("http://localhost:8080/check")
.then((res)=>{
enable.value=res.data.status
})
function clicked(){
  if (enable.value==true){
     axios.get("http://localhost:8080/login/enable")
  }else{
     axios.get("http://localhost:8080/login/disable")
  }
}


</script>

<template>
  <EnableBtn v-model="enable" ref="123" @click="clicked" />
  <qrcode/>
</template>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
